// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "GameplayModMagnitudeCalculation.h"
#include "MMC_MaxHealth.generated.h"

/**
 * 修改属性值计算类,唯一要做的就是自CalculateBaseMagnitude_Implementation()返回浮点值,
 * MMC的优势在于能够完全访问GameplayEffectSpec来读取GameplayTag和SetByCaller，
 * 从而能够捕获GameplayEffect的源(Source)或目标(Target)上任意数量的Attribute值.
 * Attribute可以被Snapshot也可以不被Snapshot,
 * Snapshotted Attribute在GameplayEffectSpec创建时被捕获
 * 而非Snapshotted Attribute在GameplayEffectSpec应用时被捕获并且该Attribute被无限(Infinite)或持续(Duration)GameplayEffect修改时会自动更新.
 * 捕获的Attribute会自ASC现有的Modifier重新计算它们的CurrentValue,该重新计算不会执行AbilitySet中的PreAttributeChange(), 
 */
UCLASS()
class AURA_API UMMC_MaxHealth : public UGameplayModMagnitudeCalculation
{
	GENERATED_BODY()

	UMMC_MaxHealth();

public:
	/**
	 *回调,根据指定的效果实例计算游戏效果修改器的基本值
	 *  UFUNCTION(BlueprintNativeEvent):在C++中提供一个默认实现,也可以在蓝图中覆盖实现.在C++中实现会有_Implementation后缀
	 */
	virtual float CalculateBaseMagnitude_Implementation(const FGameplayEffectSpec& Spec) const override;

private:
	
	FGameplayEffectAttributeCaptureDefinition VigorDef;
};
